<%-- 
    Document   : searchCustomerCommonHeader
    Created on : 1 Jan, 1980, 5:55:41 AM
    Author     : sagar
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
        <script type="text/javascript">
            var rules=new Array();
            rules[0]='mrNo|required|andor-operator';
            rules[1]='phone|required|andor-operator';
            rules[2]='customerName|required|andor-operator';
            rules[3]='0|or|1-2| plz select atleast  MR No or Phone or Customer Name';
            rules[4]='phone|mask|0123456789';
            rules[5]='phone|maxlength|10|enter only 10 digit phone number ';
        </script>
    </head>
    <body onLoad="yav.init('form1',rules,'inline');">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <%@include file="../common/message.jsp" %>
        <div class="in_02">
            <fieldset>
                <legend><spring:message code="title.searchCustomer"/></legend>
                <form:form id="form1" name="form1"  method="POST" cssClass="userInputForm" >
                    <table class="formTable">
                        <tr>
                            <td><spring:message code="enterMrNo"/>:<br/>
                                <input type="text" name="mrNo1" id="mrNo" class="userInputMedium" value="${mrNo1}"/><br/>
                            </td>
                            <td><spring:message code="phone"/>:<br/>
                                <input type="text" name="phone" id="phone" class="userInputLarge" value="${phone}"/><br/>
                                <span id="errorsDiv_phone"></span>
                            </td>
                            <td><spring:message code="customerName"/>:<br/>
                                <input type="text" name="customerName1" id="customerName1" class="userInputLarge" value="${customerName1}"/><br/></td>
                            <td><spring:message code="empId"/>:<br/>
                                <input type="text" name="empId1" id="empId1" class="userInputLarge" value="${empId1}"/><br/></td>

                            <td><input  type="submit" value="Go" name="Go"  style="margin:13px 0 0 0;" onclick="return yav.performCheck('form1', rules, 'inline'); "/></td> 
                        </tr>
                        <tr>
                            <td colspan="3"><span id=errorsDiv></span></td>
                        </tr>  
                        <tr>
                            <td style="height:auto; padding: 20px 0 0 20px; font-weight: bold; color: #ff0000;">${msg}</td>
                        </tr>
                    </table>
                </form:form>
            </fieldset>
            <h1>Customer List</h1><br/><br/>&nbsp;&nbsp;&nbsp;<c:out value="${fn:length(customerlist)}"/> <spring:message code="rowsFound"/>
            <table class="data_table" border="1px">
                <tr class="header">

                    <th><spring:message code="tbl.customerId"/></th>
                    <th><spring:message code="tbl.empId"/></th>
                    <th><spring:message code="tbl.customerName"/></th>
                    <th><spring:message code="tbl.relation"/></th>
                    <th><spring:message code="tbl.active"/></th>
                    <th><spring:message code="tbl.eligible"/></th>
                    <th><spring:message code="tbl.phone1"/></th>
                    <th><spring:message code="tbl.dispositionName"/></th>
                    <th><spring:message code="tbl.followupDate"/></th>
                    <th><spring:message code="tbl.lastModifiedDate"/></th>
                    <th>&nbsp;</th>
                </tr>
                <c:forEach items="${customerlist}" var="item">
                    <c:choose>
                        <c:when test="${item.important==true}">
                            <tr style="background-color:#FDB543;">  

                                <td><c:out value="${item.customerId}"/></td>
                                <td><c:out value="${item.empId}"/></td>
                                <td><c:out value="${item.customerName}"/></td>
                                <td><c:out value="${item.relation}"/></td>
                                <c:choose>
                                    <c:when test="${item.active == 'true' }">
                                        <td><c:out value="Yes"/></td>
                                    </c:when>
                                    <c:otherwise> 
                                        <td><c:out value="No"/></td>
                                    </c:otherwise>
                                </c:choose>
                                <c:choose>
                                    <c:when test="${item.eligible == 'true' }">
                                        <td><c:out value="Yes"/></td>
                                    </c:when>
                                    <c:otherwise>
                                        <td><c:out value="No"/></td>
                                    </c:otherwise>
                                </c:choose>
                                <td><c:out value="${item.phone1}"/></td>
                                <td><c:out value="${item.dispositionName}"/></td>
                                <td><fmt:formatDate value="${item.followupDate}" pattern="dd-MM-yy HH:mm"/></td>                      
                                <td><fmt:formatDate value="${item.lastModifiedDate}" pattern="dd-MM-yy HH:mm"/></td>
                                <td><a href="editCustomer.htm?customerId=<c:out value="${item.customerId}"/>"><img src="../images/edit.png"  width="20" height="20" style="border: none" alt="Edit" title="Edit"/></a></td>
                            </tr>
                        </c:when>
                        <c:otherwise>
                            <tr>  

                                <td><c:out value="${item.customerId}"/></td>
                                <td><c:out value="${item.empId}"/></td>
                                <td><c:out value="${item.customerName}"/></td>
                                <td><c:out value="${item.relation}"/></td>
                                <c:choose>
                                    <c:when test="${item.active == 'true' }">
                                        <td><c:out value="Yes"/></td>
                                    </c:when>
                                    <c:otherwise> 
                                        <td><c:out value="No"/></td>
                                    </c:otherwise>
                                </c:choose>
                                <c:choose>
                                    <c:when test="${item.eligible == 'true' }">
                                        <td><c:out value="Yes"/></td>
                                    </c:when>
                                    <c:otherwise>
                                        <td><c:out value="No"/></td>
                                    </c:otherwise>
                                </c:choose>
                                <td><c:out value="${item.phone1}"/></td>
                                <td><c:out value="${item.dispositionName}"/></td>
                                <td><fmt:formatDate value="${item.followupDate}" pattern="dd-MM-yy HH:mm"/></td>                      
                                <td><fmt:formatDate value="${item.lastModifiedDate}" pattern="dd-MM-yy HH:mm"/></td>
                                <td><a href="editCustomer.htm?customerId=<c:out value="${item.customerId}"/>"><img src="../images/edit.png"  width="20" height="20" style="border: none" alt="Edit" title="Edit"/></a></td>
                            </tr>
                        </c:otherwise>
                    </c:choose>
                </c:forEach>
            </table>
            <br/><br/>
        </div>
    </body>
</html>
